Computer systems use memory structures for storing and retrieving data. Sometimes, stored data becomes corrupted or the act of retrieving the stored data may corrupt the data. Typically, the computer systems employ an error-correcting code (ECC) for the detection and correction of one or more bit-errors. An encoded data element can include a data element and parity bits. For example, a 38-bit encoded data element can include a 32-bit data element (e.g., a 32-bit data element includes 32 data bits) and 6 parity bits. The parity bits can be generated based on an ECC such as a Hamming code and the data element. On retrieval of the encoded data element, checksum bits are generated based on the encoded data element. Using the checksum bits, a bit-error occurring in the data element or in the parity bits can be detected and corrected. Typically, computer systems use trees of XOR logic to compute the parity bits and the checksum bits.